﻿namespace XiaoYuStock.Model.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class init1 : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.DayData",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        ShareCode = c.String(nullable: false, maxLength: 20, storeType: "nvarchar"),
                        CurrentTime = c.String(nullable: false, maxLength: 20, storeType: "nvarchar"),
                        CurrentPrice = c.Decimal(nullable: false, precision: 18, scale: 2),
                        FloatPrice = c.Decimal(nullable: false, precision: 18, scale: 2),
                        TradeCount = c.Long(nullable: false),
                        TradeAmount = c.Decimal(nullable: false, precision: 18, scale: 2),
                        IsBuy = c.Boolean(nullable: false),
                        CurrentDate = c.DateTime(nullable: false, precision: 0),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.HistoryData",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        ShareCode = c.String(nullable: false, maxLength: 20, storeType: "nvarchar"),
                        CurrentDate = c.String(nullable: false, maxLength: 10, storeType: "nvarchar"),
                        OpenAmount = c.Decimal(nullable: false, precision: 18, scale: 2),
                        CloseAmout = c.Decimal(nullable: false, precision: 18, scale: 2),
                        MaxAmount = c.Decimal(nullable: false, precision: 18, scale: 2),
                        MinAmount = c.Decimal(nullable: false, precision: 18, scale: 2),
                        TradeCount = c.Long(nullable: false),
                        TradeAmount = c.Decimal(nullable: false, precision: 18, scale: 2),
                        TradeTime = c.DateTime(nullable: false, precision: 0),
                        CreateDate = c.DateTime(precision: 0),
                        TradeRate = c.Decimal(precision: 18, scale: 2),
                        DiffPrice = c.Decimal(precision: 18, scale: 2),
                        YesterdayCloseAmount = c.Decimal(precision: 18, scale: 2),
                        YesterdayCost = c.Decimal(precision: 18, scale: 2),
                        Support = c.String(unicode: false),
                        Pressure = c.String(unicode: false),
                        WeekTradeRate = c.String(unicode: false),
                        WeekDiffPrice = c.Decimal(precision: 18, scale: 2),
                        MonthTradeRate = c.String(unicode: false),
                        MonthDiffPrice = c.Decimal(precision: 18, scale: 2),
                        YearTradeRate = c.String(unicode: false),
                        YearDiffPrice = c.Decimal(precision: 18, scale: 2),
                        Ltg = c.Decimal(precision: 18, scale: 2),
                        Mgjzc = c.Decimal(precision: 18, scale: 2),
                        Income = c.Decimal(precision: 18, scale: 2),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.ShareList",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        ShareName = c.String(nullable: false, maxLength: 50, storeType: "nvarchar"),
                        ShareCode = c.String(nullable: false, maxLength: 20, storeType: "nvarchar"),
                        Status = c.Int(nullable: false),
                        MarketDate = c.DateTime(nullable: false, precision: 0),
                        CreateDate = c.DateTime(nullable: false, precision: 0),
                        TotalCapital = c.Decimal(nullable: false, precision: 18, scale: 2),
                        CirculateCapital = c.Decimal(nullable: false, precision: 18, scale: 2),
                        CategoryCode = c.String(unicode: false),
                        ShareType = c.Int(),
                        ShareSubType = c.String(unicode: false),
                        Remark = c.String(maxLength: 500, storeType: "nvarchar"),
                        Url = c.String(maxLength: 500, storeType: "nvarchar"),
                        ModifyDate = c.DateTime(precision: 0),
                        Flag = c.Int(),
                        PinyinCode = c.String(maxLength: 10, storeType: "nvarchar"),
                    })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.ShareList");
            DropTable("dbo.HistoryData");
            DropTable("dbo.DayData");
        }
    }
}
